5.3.3 APPX Application Design Manual

+ Chapter 1-1: Overview of Application Design
+ Chapter 1-2: Getting Started
+ Chapter 1-3: Data Dictionary
+ Chapter 1-4: Understanding Process Design
+ Chapter 1-5: Interprocess Communication
+ Chapter 1-6: Customizing Your Application
+ Chapter 1-7: The Documentation Facility
+ Chapter 1-8: Application Design Tools
+ Chapter 2-1: Data Dictionary Overview
+ Chapter 2-2: Data Dictionary Concepts
- Chapter 2-3: Domains
+ Chapter 2-4: Files and Fields
+ Chapter 2-5: Work Fields
+ Chapter 3-1: Overview of APPX Processes
+ Chapter 3-2: Getting Started
+ Chapter 3-3: Process Definition
+ Chapter 3-4: Menu Processes
+ Chapter 3-5: Job Processes
+ Chapter 3-6: Input Processes
+ Chapter 3-7: Output Processes
+ Chapter 3-8: Update Processes
+ Chapter 3-9: Query Processes
+ Chapter 3-10: Inquiry Processes
+ Chapter 3-11: Status Processes
+ Chapter 3-12: Subroutine Processes
+ Chapter 3-13: Table Processes
+ Chapter 3-14: Automatic and Optional Children
+ Chapter 3-15: Using the Image Editor
+ Chapter 3-16: Using GUI Features of the Image Editor
+ Chapter 3-17: Using Event Points
+ Chapter 4-1: ILF Integration
+ Chapter 4-2: True/False Status Indicators
+ Chapter 4-3: Specifying Statements
+ Chapter 4-4: The ILF Editor
+ Chapter 4-5: The Appx ILF Debugger
+ Chapter 4-6: ILF Keyword Reference
+ Chapter 4-7: Predefined Fields
+ Chapter 4-8: Runtime Subroutine's and Predefined Processes
+ Chapter 4-9: Appx Chart Director API

Chapter 2-3: Domains

Numeric Storage Types


There are three storage types available for numeric domains, numeric fields, and numeric work fields. These are discussed in detail below.

BINARY ? The number is stored in binary form. The high order bit determines the sign: on or 1 for positive, and off or 0 for negative. The decimal position is established by the Decimals -- Left/Right entries. Binary storage is appropriate when the associated data has a fixed decimal position, and a maximum of 10 significant digits for non-decimal values (9999999999) or nine digits for decimal values (9999999.99). Dollar amounts, for example, where you know there are always two digits to the right of the decimal, are particularly suited for this type of storage.

Binary storage minimizes storage space requirements and maximizes performance. There are no restrictions imposed on the mathematical operations that you can perform on binary data.

The internal storage length for binary fields is either one, two, or four bytes. The specific storage length depends upon the maximum number of digits in a field, whether or not a field is signed, and range checks, if any.

To calculate the storage length for a binary field, you determine the smallest of the signed and unsigned ranges in Table 2-3-1 that contains all the possible values for the field, including any range check values. For example, a field with possible values from 0 to 255 requires two bytes of storage rather than one byte if it includes a range check of LE 256. 

Storage

Range of Signed Numerics

Range of Unsigned Numerics

One Byte

  -128 to +127

  0 to 255

Two Bytes

  -32,768 to +32,767

  0 to 65,535

Four Bytes

  -2,147,483,648 to +2,147,483,647

  0 to 4,294,967,295

Table 2-3-1. Internal Storage Lengths for Binary Fields

Note that ranges with maximum and minimum values of two digits or less always require one byte of storage. Ranges consisting of values in excess of five digits always require four bytes.

FIXED DECIMAL employs a packed decimal format that stores two decimal digits for each byte with the exception of the last bit, which is the sign bit. The decimal position is established by the Decimals ? Left/Right entries.

Fixed decimal storage is appropriate for fields with lengths greater than the lengths that are permitted for binary storage, and for which a constant decimal position can be assigned. The maximum field length is 31 significant digits.

This option requires more bytes of internal storage than a binary field, but less than a variable decimal field. To calculate the internal storage length of a fixed decimal field, apply the following formula and round up to the nearest byte:

(Total Digits + 1) / 2

For example, a field with 10 digits requires six bytes of storage: (10 + 1) / 2, rounded up to the nearest byte.

FLOATING DECIMAL employs a combination of binary and packed decimal formats that always requires a total of nine bytes of storage. Although the field definition allows for 15 digits to the left of the decimal point plus 15 digits to the right of the decimal point, only the first 15 digits of the actual number are stored. These 15 digits are stored as packed decimal with two decimal digits for each byte (for a total storage requirement of eight bytes). The final byte (binary) determines the maximum number of digits that currently appears to the right of the decimal.

Floating decimal storage is appropriate for decimal fields without a consistent decimal position. These fields are limited to a maximum of 15 significant digits. There are no restrictions imposed on the mathematical operations that you can perform on floating decimal fields.

This option requires more bytes of internal storage for any given number of significant digits than either of the other options, or a consistent nine bytes. These nine bytes are composed of eight bytes stored in a packed decimal format (for the 15 digits), and a one-byte binary value that stores the current location of the decimal point (0 to 15).

The default is FIXED DECIMAL. Actual storage requirements are determined by the Storage Type, Decimals ? Left/Right, Signed?, and Range Checks specifications.

The attributes of each of the three storage types, binary, fixed decimal, and floating decimal, are summarized in Table 2-3-2 below. 

Attribute

Binary

Fixed Decimal

Floating Decimal

Decimal Position

Fixed

Fixed

Variable

Storage Requirements

Minimum

Intermediate

Maximum

Digit Limitation

10 (or 9 with decimal)

31

15 significant digits

Performance

Best

Intermediate

Worst

Table 2-3-2. A Comparison of Storage Types for Numeric Domains/Fields

 

Application Design Manual                                         "Powered by Appx Software"

168

©2006 By APPX Software, Inc. All Rights Reserved